<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function Person(num, age) {
        this.num = num;
        this.age = age;

        this.add = function () {
            console.log('num:', this.num, 'age:', this.age)
        }
    }

    var p = new Person(1,2);
    p.add()
</script>
</body>
</html>
